<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/validator.js"></script>
<form action="<?=url('Sales::Edm/CreateSave')?>" method="post">
  	<table width="100%" class="form_table" >
		<tr>
			<th>已制作EDM</th>
			<td>
			
			<select name="site_selector" id="site_selector" onchange='location.href = location.href.replace(/\&site_selector\=[^\&]*/g,"") + "&site_selector=" + this.value; ' >
				<option value=''> -- 选择站点 -- </option>
				<option value='iwowcase.com' <?php if ($currentSite == 'iwowcase.com' ) { echo 'selected="selected"'; } ?> >iwowcase.com</option>	
				<option value='glwf.com' <?php if ($currentSite == 'glwf.com' ) { echo 'selected="selected"'; } ?> >glwf.com</option>	
			</select>
			
			<select name="year_selector" id="year_selector" onchange='location.href = location.href.replace(/\&year_selector\=[^\&]*/g,"") + "&year_selector=" + this.value; ' >
			<option value=''> -- 选择年份 -- </option>
			<?foreach ($yearSelector as $v):?>
			<option value='<?=$v;?>' <?php if ($currentYear == $v ) { echo 'selected="selected"'; } ?> > <?=$v;?> </option>	
			<?php endforeach ?>
			</select>
			
			<select name="folder_selector" id="folder_selector" onchange='location.href = location.href.replace(/\&folder_selector\=[^\&]*/g,"") + "&folder_selector=" + this.value; ' >
			<option value=''> -- 请选择一个已制作EDM或直接填写 -- </option>
			<?if (!empty($mailfoldername[0])) foreach ($mailfoldername as $v):?>
			<option value='<?=$v;?>' <?php if ($currentFolderName == $v ) { echo 'selected="selected"'; } ?> > <?=$v;?> </option>	
			<?php endforeach ?>
			</select>
			
			</td>
		</tr>
		<tr>
			<th>名称 Name&GACampaign</th>
			<td><input type="text" name="name" id="name" size="60" value="<?=$name;?>" /> <span class="red">*</span> <span class="sample_text"><em>20120407_iwc_always_finding_new_cases</em></span></td>
		</tr>
		<tr>
			<th>邮件标题 Subjects</th>
			<td><input type="text" name="subjects" id="subjects" size="60" value="<?=$subjects;?>" /> <span class="red">*</span> <span class="sample_text"><em>Always Finding New Cases for iPhone/new iPad</em></span></td>
		</tr>
		<tr>
			<th>发送日期 Schedule Date</th>
			<td><input type="text" name="schedule_date" size="32" id="schedule_date" value="<?=$schedule_date;?>" /> <span class="red">*</span> <span class="sample_text"> In UTC, such as '<em>7 April 2012 13:00</em> '</span></td>
		</tr>
		<tr>
			<th>选择账号</th>
			<td>
				<select name="bmail_account"  onchange='location.href = location.href.replace(/\&bmail_account\=[^\&]*/g,"") + "&bmail_account=" + this.value; '>
					<option value='' > -- 请选择一个账号 --</option>
					<?foreach ($bmailAccount as $k => $v):?>
					<option value="<?=$k?>" <?php if ($currentAccount == $k) echo "selected='selected'"; ?>><?=$k?></option>
					<?php endforeach ?>
				</select>
			</td>
		</tr>
		<tr>
		<tr>
			<th>收件客户邮件列表 To MailGroup</th>
			<td><select name="to_listid" id="to_listid" >
			<option value=''> -- 请选择一个客户邮件列表 -- </option>
			<?foreach ($toMailGroup as $v):?>
			<option value='<?=$v['id'];?>' > <?=$v["listname"];?> (<?=$v["contactcount"];?>) </option>	
			<?php endforeach ?>
			</select> <span class="red">*</span> </td>
		</tr>
		<tr>
			<th>发信邮箱 From Email</th>
			<td><input type="text" name="from_mail" size="24" id="from_mail" value="<?=$from_mail;?>" /> <span class="red">*</span> </td>
		</tr>
		<tr>
			<th>发信人 From Name</th>
			<td><input type="text" name="from_name" size="24" id="from_name" value="<?=$from_name;?>" /> <span class="red">*</span> </td>
		</tr>
		<tr>
			<th>回信邮箱 Reply Email</th>
			<td><input type="text" name="reply_email" size="24" id="reply_email" value="<?=$reply_email;?>" /> <span class="red">*</span> </td>
		</tr>
		<tr>
			<th>内容（HTML）</th>
			<td><textarea type="text" name="html_contents" id="html_contents" cols="90" rows="20" ><?=$html_contents;?></textarea> <span class="red">*</span></td>
		</tr>
		<tr>
			<td ></td>
			<td ><input type="submit" value=" 添加 " /></td>
		</tr>
	</table>
  
  </form>
  
<?php $this->_endblock(); ?>